goods = {"RTX4070": 100, "RX9070": 50, "14900K": 80, "长城1T固态硬盘": 20, "1000W金牌电源": 60,
         "ROG败家之眼机械键盘": 30}
shoppingCar = []


def Shopping(account, goods, shoppingCar):
    while True:
        print("欢迎进入购物商城")
        print("商品列表如下:")
        for i in goods.keys():
            print(i, goods[i])
        print("你想购买哪个商品？")
        good = input()
        if good not in goods:
            print("没有这个商品，别瞎弄！")
        elif account < goods[good]:
            print("穷鬼，钱不够！请到其他超市购买！")
        else:
            shoppingCar.append(good)
            account = account - goods[good]
            print("购买成功！")
            print("你还有{}元钱！".format(account))
        ifgoon = input("是否继续购物(y/Q(q)")
        if ifgoon == "y":
            continue
        elif ifgoon == "Q" or ifgoon == "q":
            print("欢迎下次再来,这是你的小票")
            for i in shoppingCar:
                print(i + "价格：" + str(goods[i]))
            break


Shopping(500, goods, shoppingCar)
